/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bsc.ejb.service;

import bsc.ejb.entity.Comparator;
import bsc.ejb.entity.Settings;
import java.util.Calendar;
import java.util.Date;

/**
 *
 * @author Memo
 */
public class FacadeUtils {

    public static Date inicialDate(Comparator comparator){
        Date now = Calendar.getInstance().getTime();
        long days = 0;
        Settings.Temporality temporality = comparator.getSettings().getTemporality();
        switch(temporality){//calculates how many days this temp represents
            case LAST:
            case X_MONTHLY:
            case X_YEARLY:
        }
        Calendar inicialDate = Calendar.getInstance();
        long daysMili = days*1000*60*60*24;
        Calendar fechamin = Calendar.getInstance();
        fechamin.setTimeInMillis(inicialDate.getTimeInMillis()-daysMili);

        return fechamin.getTime();
    }
}
